package com.sss.hloster0703;

public class TestEx06 {

	public static void main(String[] args) {
            try {
            	doEx1();
            }catch(ArrayIndexOutOfBoundsException e) {//再次捕获数组下标越界异常
            	System.out.println("main  方法中处理数组下标越界异常！");
            }finally {
            	System.out.println("程序结束！！");
            }
	}

	public static void doEx1() {
		try {
			String teachers[] = { "王林", "韩立", "苏铭" };
			for (int i = 0; i < 4; i++) {
				System.out.print(teachers[i] + "   ");
			}
		} catch (ArrayIndexOutOfBoundsException e) {//捕获数组下标越界异常
			System.out.println();
			System.out.println("doEx1 方法中处理数组下标越界异常！");
			throw e;                                                                  //再次抛出该数组下标越界异常
		}
	}
}
